package com.itheima;

import java.util.ArrayList;
import java.util.LinkedList;

public class LinkedListDemo {
    public static void main(String[] args) {
        LinkedList<String> list= new LinkedList<>();
        list.add("张三");
        list.add("李四");
        list.add("王五");
        list.add("赵六");
        list.add("钱七");

        String s= list.get(3);


        String first= list.getFirst();
        System.out.println(first);
        String last= list.getLast();
        System.out.println(last);


        String removeFist=list.removeFirst();
        System.out.println(removeFist);
        String removeLst=list.removeLast();
        System.out.println(removeLst);

    }
}
